package cn.yunhe.dao;

import cn.yunhe.entity.Member;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MemberDao {

    @Select("select * from member")
    List<Member> findAll();

    @Select("select * from member where id =#{id}")
    Member selectById(Integer id);

    @Insert("insert into member values (null,#{name},#{nickName},#{phoneNum},#{email})")
    void insertMember(Member member);

    @Delete("delete from member where id=#{id}")
    void deleteMember(Integer id);

}
